Get RAW values of the servo outputs#1198
Conversation
The RAW values of the servo outputs.
An object of this type is returned by :py:attr:`Vehicle.servos`.
:param port: Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
:param servo_raw['1'] ~ servo_raw['16']: Servo output 1 ~ 16 value.
spelling mistake correction
|
Sorry for the delay in taking a look at this. Overall, it looks good to me. Did you do any testing on actual hardware for this change? |
When running ardupilot firmware using the sitl method, SERVO_OUTPUT_RAW usually uses mavlink 2.0, whereas this message usually uses mavlink 1.0 when I run ardupilot firmware using the Cube Orange, which makes it impossible to get the values from servo9_raw to servo16 _raw values. So I used len(m.lengths) to get the actual number of servo_outputs.
Yes, I recently tested this new feature using a Cube Orange and a CUAV X7+. I found some problems with the previous code. When running ardupilot firmware using the sitl method, SERVO_OUTPUT_RAW usually uses mavlink 2.0, whereas this message usually uses mavlink 1.0 when I run ardupilot firmware using Cube Orange, which makes it impossible to get the servo9_raw to servo16 _raw values. So in the latest code I used len(m.lengths) to get the actual number of servo_outputs to prevent errors. |
@morzack Thank you for replying to my email, I would love to be a maintainer of this program!
The RAW value of the servo output can be acquired based on the SERVO_OUTPUT_RAW information.
An object of this type is returned by :py:attr:
Vehicle.servos.:param port: Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
:param servo_raw['1'] ~ servo_raw['16']: Servo output 1 ~ 16 value.